package org.kl.bpm.entity.conf;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.kl.bf.entity.Excel;
import org.kl.bf.entity.IdEntity;
import org.kl.bf.entity.basic.CodeValues;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 
 * @Author hqm
 * @CreateTime 2014年5月25日 下午7:54:57
 */
@Entity
@Table(name = "BPM_PROCESS")
public class BpmProcess extends IdEntity {
	private static final long serialVersionUID = 0L;
	@Excel(exportName = "流程名称")
	private String name;
	@Excel(exportName = "流程类型", exportProperty = "codeName")
	private CodeValues bpmCategory;
	@Excel(exportName = "流程代码")
	private String code;
	@Excel(exportName = "流程定义ID|流程定义Key|流程定义版本", exportProperty = "processDefinitionId|processDefinitionKey|processDefinitionVersion")
	private BpmConfBase bpmConfBase;
	@Excel(exportName = "顺序")
	private Integer priority;
	@Excel(exportName = "配置任务负责人")
	private Integer useTaskConf;
	@Excel(exportName = "业务单据URL")
	private String businessFormUrl;
	@Excel(exportName = "描述")
	private String descn;

	private String lastConfBaseId;
	private Set<BpmDelegateInfo> BpmDelegateInfo;

	@OneToMany(mappedBy = "bpmProcess")
	@JsonIgnore
	public Set<BpmDelegateInfo> getBpmDelegateInfo() {
		return BpmDelegateInfo;
	}

	public void setBpmDelegateInfo(Set<BpmDelegateInfo> BpmDelegateInfo) {
		this.BpmDelegateInfo = BpmDelegateInfo;
	}

	public BpmProcess() {
	}

	public BpmProcess(BpmConfBase bpmConfBase, CodeValues bpmCategory, String name, Integer priority, String descn, Integer useTaskConf,
			String code) {
		this.bpmConfBase = bpmConfBase;
		this.bpmCategory = bpmCategory;
		this.name = name;
		this.priority = priority;
		this.descn = descn;
		this.useTaskConf = useTaskConf;
		this.code = code;
	}

	/** @return null. */
	@ManyToOne
	@JoinColumn(name = "conf_base_id")
	public BpmConfBase getBpmConfBase() {
		return this.bpmConfBase;
	}

	/**
	 * @param bpmConfBase
	 *            null.
	 */
	public void setBpmConfBase(BpmConfBase bpmConfBase) {
		this.bpmConfBase = bpmConfBase;
	}

	/** @return null. */
	@ManyToOne
	@JoinColumn(name = "process_category")
	public CodeValues getBpmCategory() {
		return this.bpmCategory;
	}

	/**
	 * @param bpmCategory
	 *            null.
	 */
	public void setBpmCategory(CodeValues bpmCategory) {
		this.bpmCategory = bpmCategory;
	}

	/** @return null. */
	@Column(name = "process_name", length = 200)
	public String getName() {
		return this.name;
	}

	/**
	 * @param name
	 *            null.
	 */
	public void setName(String name) {
		this.name = name;
	}

	/** @return null. */
	@Column(name = "PRIORITY")
	public Integer getPriority() {
		return this.priority;
	}

	/**
	 * @param priority
	 *            null.
	 */
	public void setPriority(Integer priority) {
		this.priority = priority;
	}

	/** @return null. */
	@Column(name = "process_desc", length = 200)
	public String getDescn() {
		return this.descn;
	}

	/**
	 * @param descn
	 *            null.
	 */
	public void setDescn(String descn) {
		this.descn = descn;
	}

	/** @return null. */
	@Column(name = "is_user_conf")
	public Integer getUseTaskConf() {
		return this.useTaskConf;
	}

	/**
	 * @param useTaskConf
	 *            null.
	 */
	public void setUseTaskConf(Integer useTaskConf) {
		this.useTaskConf = useTaskConf;
	}

	/** @return null. */
	@Column(name = "process_code", length = 64)
	public String getCode() {
		return this.code;
	}

	/**
	 * @param code
	 *            null.
	 */
	public void setCode(String code) {
		this.code = code;
	}

	public String getLastConfBaseId() {
		return lastConfBaseId;
	}

	public void setLastConfBaseId(String lastConfBaseId) {
		this.lastConfBaseId = lastConfBaseId;
	}

	public String getBusinessFormUrl() {
		return businessFormUrl;
	}

	public void setBusinessFormUrl(String businessFormUrl) {
		this.businessFormUrl = businessFormUrl;
	}

}
